using System.Collections.Generic;
using UnityEngine;

namespace HEFramework
{
    /// <summary>
    /// Skill data,Skill.xlsx
    /// </summary>
    public class DRSkill:IData
    {
        
        /// <summary>
        /// ID  different
        /// </summary>
        public int ID { get; protected set; }
        /// <summary>
        /// 名字  outputKey
        /// </summary>
        public string Name { get; protected set; }
        /// <summary>
        /// 描述  outputKey
        /// </summary>
        public string Description { get; protected set; }
        /// <summary>
        /// AB路径  
        /// </summary>
        public string ABPath { get; protected set; }
        /// <summary>
        /// AB昵称  
        /// </summary>
        public string ABName { get; protected set; }
        /// <summary>
        /// 技能类型  
        /// </summary>
        public int Type { get; protected set; }
        /// <summary>
        /// 解锁等级  
        /// </summary>
        public int LockLV { get; protected set; }
        /// <summary>
        /// 解锁阶级  
        /// </summary>
        public int LockRANK { get; protected set; }
        /// <summary>
        /// 被动冷却（毫秒）  
        /// </summary>
        public int PCooldown { get; protected set; }
        /// <summary>
        /// 主动冷却（毫秒）  
        /// </summary>
        public int ACooldown { get; protected set; }
        /// <summary>
        /// 主动施法吟唱（毫秒）  
        /// </summary>
        public int ACasting { get; protected set; }
        /// <summary>
        /// 主动施法距离（厘米）  
        /// </summary>
        public int ARange { get; protected set; }
        /// <summary>
        /// 被动消耗类型组  
        /// </summary>
        public int[] PCostTypes { get; protected set; }
        /// <summary>
        /// 被动消耗值组  
        /// </summary>
        public int[] PCostValues { get; protected set; }
        /// <summary>
        /// 主动消耗类型组  
        /// </summary>
        public int[] ACostTypes { get; protected set; }
        /// <summary>
        /// 主动消耗值组  
        /// </summary>
        public int[] ACostValues { get; protected set; }
        /// <summary>
        /// 被动触发类型  
        /// </summary>
        public int PTriggerType { get; protected set; }
        /// <summary>
        /// 被动效果ID组  
        /// </summary>
        public int[] PEffectIDs { get; protected set; }
        /// <summary>
        /// 主动效果ID组  
        /// </summary>
        public int[] AEffectIDs { get; protected set; }

        
        public void ParseDataRow(string input)
        {
            string[] text = input.Split('	');
            int index = 0;
        
            ID = int.Parse(text[index++]);
            Name = DataTableExtension.GetStringFromKey(text[index++]);
            Description = DataTableExtension.GetStringFromKey(text[index++]);
            ABPath = text[index++];
            ABName = text[index++];
            Type = int.Parse(text[index++]);
            LockLV = int.Parse(text[index++]);
            LockRANK = int.Parse(text[index++]);
            PCooldown = int.Parse(text[index++]);
            ACooldown = int.Parse(text[index++]);
            ACasting = int.Parse(text[index++]);
            ARange = int.Parse(text[index++]);
            PCostTypes = DataTableExtension.ParseIntArr(text[index++]);
            PCostValues = DataTableExtension.ParseIntArr(text[index++]);
            ACostTypes = DataTableExtension.ParseIntArr(text[index++]);
            ACostValues = DataTableExtension.ParseIntArr(text[index++]);
            PTriggerType = int.Parse(text[index++]);
            PEffectIDs = DataTableExtension.ParseIntArr(text[index++]);
            AEffectIDs = DataTableExtension.ParseIntArr(text[index++]);

        }
        
        private void AvoidJIT()
        {
            new Dictionary<int, DRSkill>();
        }
    }
}